function check_perm1(per_name, flag) {
    var that=this
    flag = flag || false;
    let now = Date.now();
    let appId = 'A6086660823294';
    let appKey = '18B51F5A-5D9B-143E-30FB-FAF804B457EF';
    appKey = hex_sha1(appId + "UZ" + appKey + "UZ" + now) + "." + now;
    let role = localStorage.role;
    let url = 'https://d.apicloud.com/mcm/api/admin_role?filter[where][role]=' + encodeURIComponent(role);
    let bbbb = true;
    
        $.ajax({
            "url": url,
            "method": "GET",
            "cache": false,
            "async": false,
            "headers": {
                "X-APICloud-AppId": appId,
                "X-APICloud-AppKey": appKey,
            },
            "success": function(data, status) {
                let qx;
               
                if (JSON.stringify(data) == '[]') {
                    qx = null;
                }
                else {
                    qx = data[0].role_list;
                }

                if (qx == null || qx == '' || qx == undefined) {
                    
                    return false
                }

                let qx_list = qx.toString();
                 if (qx_list.indexOf(per_name)==-1){
                     if (flag=='0'){
                        window.location='sorry.html' 
                        return false
                     }
                     else{
                         that=false
                     }
                 }
                 else{
                     that=true
                 }
            }})
            return that
}
